import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/login', component: () => import('@/views/Login/index.vue') },
    { path: '/',
      component: () => import('@/views/Layout/LayoutContainer.vue'),
      redirect: '/login',
      children: [
        {
          path: '/order/myorder',
          component: () => import('@/views/Order/MyOrder.vue')
        },
        {
          path: '/product/productlist',
          component: () => import('@/views/Product/ProductList.vue')
        },
        {
          path: '/user/center',
          component: () => import('@/views/User/UserCenter.vue')
        },
        {
          path: '/user/update',
          component: () => import('@/views/User/UpdateMessage.vue')
        },
        {
          path: '/user/profit',
          component: () => import('@/views/User/MyProfit.vue')
        }
      ]
    },
    { path: '/squre', component: () => import('@/views/squre/index.vue')}
  ]
})

export default router
